/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test1;

/**
 *
 * @author Administrator
 */
public class Test_StringSplit {

    public static void main(String[] args) {
        
        String str1 = "1,2,3,4";
        String[] arr1 = str1.split(",");
        System.out.println("--> arr1 length : " + arr1.length);
        
        String str2 = "1|2|3|4";
        String[] arr2 = str2.split("|");
        System.out.println("--> arr2 length : " + arr2.length);
        
        String str3 = "1|2|3|4";
        String[] arr3 = str3.split("");
        System.out.println("--> arr3 length : " + arr3.length);
        
        String str4 = "1|2|3|4";
        String[] arr4 = str4.split("\\|");
        System.out.println("--> arr4 length : " + arr4.length);
        
    }
}
